package instantmessenger;

import java.rmi.server.UnicastRemoteObject;
import java.rmi.*;
import javax.swing.JTextArea;

public class ListenerImpl extends UnicastRemoteObject implements Listener {

    JTextArea txtareaMessages;

    ListenerImpl(JTextArea clientTxtarea) throws RemoteException {
        txtareaMessages = clientTxtarea;
    }

    public void messageReceived(String user, String message) throws RemoteException {
        txtareaMessages.append(user + ": " + message + "\n");
    }
}

